﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ProjList.aspx.cs" Inherits="HelfenHelfen.Web.Forms.Site.ProjList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ObjectDataSource ID="odsModel" runat="server" SelectMethod="GetAll" TypeName="HelfenHelfen.Logic.Factories.DemandLogicAdapter`1[[HelfenHelfen.Logic.DemandLogic, HelfenHelfen.Logic]]">
        <SelectParameters>
            <asp:SessionParameter Name="city" SessionField="Search_City" DbType="String" />
            <asp:SessionParameter Name="category" SessionField="Search_Category" DbType="Guid" />
            <asp:SessionParameter Name="date" SessionField="Search_Date" DbType="DateTime" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <h1>
        PROJEKT-LISTE</h1>
    <p>
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula
        eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient
        montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu,
        pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla
        vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a,
        venenatis vitae, justo. Nullam dictum felis eu pede mollis
    </p>
    <div class="projectlist">
        <asp:ListView ID="lvProjectList" runat="server" OnSelectedIndexChanged="lvProjectList_SelectedIndexChanged"
            OnSelectedIndexChanging="lvProjectList_SelectedIndexChanging" DataSourceID="odsModel"
            DataKeyNames="DemandGUID">
            <LayoutTemplate>
                <asp:PlaceHolder runat="server" ID="itemPlaceHolder" />
            </LayoutTemplate>
            <ItemTemplate>
                <div class="project">
                    <div class="thumbnail hide">
                        <asp:Image ID="imgProject" runat="server" ImageUrl='<%# "~/ShowImageByDemand.ashx?id=" + Eval("DemandGUID") %>' />
                    </div>
                    <!-- .thumbnail -->
                    <h2>
                        <asp:LinkButton ID="lbProject" runat="server" PostBackUrl="~/ProjDetail.aspx"><%# Eval("Title") %></asp:LinkButton> <img class="expander"/></h2>
                    <div class="description hide">
                        <asp:Label runat="server" ID="lbl">"<%# Eval("Description") %>" </asp:Label>
                    </div>
                    <!-- .description -->
                </div>
                <!-- .project -->
            </ItemTemplate>
        </asp:ListView>
        <div class="pager clearfix">
            <div class="pages">
                <asp:DataPager ID="dbProjectList" runat="server" PagedControlID="lvProjectList" ClientIDMode="Static"
                    PageSize="3" OnPreRender="dbProjectList_PreRender">
                    <Fields>
                        <asp:NumericPagerField NumericButtonCssClass="datapager" CurrentPageLabelCssClass="datapager dpselected"
                            NextPageText="Weiter" PreviousPageText="Zurück I " ButtonCount="3" RenderNonBreakingSpacesBetweenControls="false">
                        </asp:NumericPagerField>
                    </Fields>
                </asp:DataPager>
            </div>
        </div>
        <!-- .pager -->
    </div>
    <!-- .projectlist -->

    <script type="text/javascript">
        $(document).ready(function () {
            var expander = $("img.expander");

            $(expander).click(function () {
                var parent = $(this).parent().parent();

                var td = parent.children(".thumbnail");
                var dd = parent.children(".description");

                if (td.is(":hidden")) {
                    td.show("slow");
                    dd.show("slow");
                }
                else {
                    td.hide("slow");
                    dd.hide("slow");
                }

                return false;
            });
        });
    </script>
</asp:Content>
